#include <iostream>
#include <string.h>
int divide(int n);
int subProblem(int A[], int n);
int subProblem(int A[], int n)
{
    if (A[n] != 0) return A[n];
    int sum = 0;
    for (int k = 2; k <= n - 1; k++)
    {
        if (A[k] == 0){
            A[k] = subProblem(A, k);
        }
        if (A[n-k+1] == 0){
            A[n-k+1] = subProblem(A, n-k+1);
        }
        sum += A[k] * A[n-k+1];
    }
    A[n] = sum;
    return A[n];
}
int divide(int n)
{
    int A[n+1];
    memset(A, 0, sizeof(A));
    A[2] = 1;
    A[3] = 1;
    return subProblem(A, n);
}
int main()
{
    using namespace std;
    cout << divide(5) << endl;
    return 0;
}